<template>
	<view class="list">
		<view class="item">
			<view class="item_top">
				<view class="item_top-left">
					<text>{{obj.content}}</text>
					<text>提交时间：{{obj.date}}</text>
				</view>
				<view class="item_top-right">
					<view>
						<button :style="color1">
							{{obj.type}}
						</button>
					</view>
					<view v-if="isShow">
						<button :style="color2">{{obj.isDefine?'已确认':'待确认'}}</button>
					</view>
				</view>
			</view>
			<view class="item_bottom">
				<!-- <textarea style="height: 60px;"  name="" id="" cols="30" rows="20"></textarea> -->
				<view class="reply">
					<text>答复：</text>
					<text>{{obj.reply}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'Comment',
		props: {
			obj: {
				type: Object,
				default: {}
			}
		},
		created() {},
		computed: {
			color1() {
				let obj = {}
				if (this.obj.type == '投诉举报') {
					obj.color = '#dd675d';
					obj.backgroundColor = '#fceded';
					obj.border = '1rpx solid #dcaaab';
				} else if (this.obj.type == '意见建议') {
					obj.color = '#b3b2b3';
					obj.backgroundColor = '#e3e3e3';
					obj.border = '1rpx solid #b5b5b5';
				} else if (this.obj.type == '问题咨询') {
					obj.color = '#e49a30';
					obj.backgroundColor = '#ffefe2';
					obj.border = '1rpx solid #cfa97f';
				}
				return obj;
			},
			color2() {
				let obj = {}
				if (this.obj.isDefine) {
					obj.color = '#69ae54';
					obj.backgroundColor = '#eefff2';
					obj.border = '1rpx solid #81b36d';
				} else {
					obj.color = '#4883c6';
					obj.backgroundColor = '#e9f5f6';
					obj.border = '1rpx solid #5c82af';
				}
				return obj;
			},
			isShow() {
				return typeof this.obj.isDefine == 'undefined' ? false : true;
			}
		},
		data() {
			return {

			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/common/style/flex.scss';

	.list {
		padding: 0 40rpx;
		font-size: 26rpx;
		margin-bottom: 40rpx;

		.item {
			@include flex-c;
			background-color: #f7f7f7;
			padding: 30rpx;
			border-radius: 12rpx;

			.item_top {
				@include flex-r-between-start;

				.item_top-left {

					>text:last-child {
						margin-top: 10rpx;
						font-size: 20rpx;
					}
				}

				.item_top-right {
					margin-left: 60rpx;

					view {
						button {
							height: 35rpx;
							line-height: 35rpx;
							padding: 0 5rpx;
							text-align: center;
							white-space: nowrap;
							display: block;
							border: 1rpx solid #b5b5b5;
							border-radius: 5rpx;
							font-size: 22rpx;
						}

					}

					view:not(:first-child) {
						margin-top: 6rpx;
					}
				}
			}

			.item_bottom {
				margin-top: 30rpx;

				.reply {
					background-color: #fff;
					border-radius: 6rpx;
					height: 100rpx;
					padding: 10rpx;

					>text:last-child {
						font-size: 20rpx;
					}
				}
			}
		}
	}
</style>